# -*- coding: utf-8 -*-

from odoo import models, fields


class Health_Checkup(models.Model):
    _name = 'health.checkup'
    _description = '健康体检表'

    healthCheck = fields.Char(string="体检编号", required=True)
    phrId = fields.Char(string="健康档案号", required=True)
    checkId = fields.Char(string="条码编号", required=True)
    resident_id = fields.Many2one("basic_info", ondelete='set null', string="居民ID", index=True)
    checkDate = fields.Date(string="年检日期", default=fields.Date.today())
    phy_exam_date = fields.Date(string="体检日期", default=fields.Date.today())
    temperature = fields.Float(string='体温')
    pulse = fields.Float(string='脉率')
    breathe = fields.Char(string="呼吸频率（次/分钟）")
    left_systolic_press = fields.Char(string="左侧收缩压")
    left_distolic_press = fields.Char(string="左侧舒张压")
    right_systolic_press = fields.Char(string="右侧收缩压")
    right_distolic_press = fields.Char(string="右侧舒张压")
    height = fields.Float(string='身高')
    weight = fields.Float(string='体重')
    waistline = fields.Float(string='腰围')
    bmi = fields.Float(string='体质指数(Kg/m2)')

    healthStatus = fields.Selection([
        ('1', '满意'),
        ('2', '基本满意'),
        ('3', '说不清楚'),
        ('4', '不太满意'),
        ('5', '不满意')],
        string="老年人健康状态自我评估")
    selfCare = fields.Selection([
        ('1', '可自理（0~3分）'),
        ('2', '轻度依赖（4~8分）'),
        ('3', '中度依赖（9~18分）'),
        ('4', '不能自理（>=）'),
        ('5', '不满意')],
        string="老年人生活自理能力评估")
    cognitive = fields.Selection([
        ('1', '粗筛阴性'),
        ('2', '粗筛阳性')],
        string="老年人认知功能")
    cognitiveZf = fields.Float(string='简易智力检查总分')
    emotion = fields.Selection([
        ('1', '粗筛阴性'),
        ('2', '粗筛阳性')],
        string="老年人情感状态")
    emotionZf = fields.Float(string='老年人抑郁评分')
    phy_exer_frq = fields.Selection([
        ('1', '每天'),
        ('2', '每周一次以上'),
        ('3', '偶尔'),
        ('4', '不锻炼')],
        string="体育锻炼-锻炼频率")
    phy_exer_time = fields.Integer(string="体育锻炼-每次锻炼时间")
    phy_exer_stick_time = fields.Integer(string="体育锻炼-坚持锻炼时间")
    phy_exer_other_form = fields.Char(string="体育锻炼-其他锻炼方式")
    smoking_info_status = fields.Selection([
        ('1', '从不吸烟'),
        ('2', '已戒烟'),
        ('3', '吸烟')],
        string="吸烟情况-吸烟状况")
    smoking_info_daily = fields.Integer(string="吸烟情况-日吸烟量")
    smoking_info_start = fields.Integer(string="吸烟情况-开始吸烟年龄")
    smoking_info_cess = fields.Integer(string="吸烟情况-戒烟年龄")
    drk_info_frq = fields.Selection([
        ('1', '从不'),
        ('2', '偶尔'),
        ('3', '经常'),
        ('4', '每天')],
        string="饮酒情况-饮酒频率")
    drk_info_vol = fields.Float(string='饮酒情况-日饮酒量')
    drk_info_is_abs = fields.Selection([
        ('1', '未戒酒'),
        ('2', '已戒酒')],
        string="饮酒情况-是否戒酒")
    drk_info_abs_age = fields.Integer(string="饮酒情况-戒酒年龄")
    drk_info_start_drk = fields.Integer(string="饮酒情况-开始饮酒年龄")
    drk_info_is_abs_year = fields.Selection([
        ('1', '是'),
        ('2', '否')],
        string="饮酒情况-近一年是否醉酒")
    occput_hazfact_contact_his = fields.Integer(string="职业病危害因素接触史")

    work_type = fields.Char(string="工种")
    work_hours = fields.Integer(string="工作时间")
    organ_func_oral_lip = fields.Selection([
        ('1', '红润'),
        ('2', '苍白'),
        ('3', '发绀'),
        ('4', '破裂'),
        ('5', '疱疹')],
        string="脏器功能-口腔-口唇")
    organ_func_oral_pharynx = fields.Selection([
        ('1', '无充血'),
        ('2', '充血'),
        ('3', '淋巴滤泡增生')],
        string="脏器功能-口腔-咽部")
    l_eye_vision = fields.Float(string='左眼视力')
    r_eye_vision = fields.Float(string='右眼视力')
    l_eye_vision_cor = fields.Float(string='左眼矫正视力')
    r_eye_vision_cor = fields.Float(string='右眼矫正视力')
    hearing = fields.Selection([
        ('1', '听见'),
        ('2', '听不清或无法听见')],
        string="听力")
    motor_func = fields.Selection([
        ('1', '可顺利完成'),
        ('2', '无法独立完成其中任何一个动作')],
        string="运动功能")
    fundus = fields.Selection([
        ('1', '正常'),
        ('2', '异常')],
        string="眼底")
    ab_fundus_descr = fields.Char(string="眼底异常描述")
    skin = fields.Selection([
        ('1', '正常'),
        ('2', '潮红'),
        ('3', '苍白'),
        ('4', '发绀'),
        ('5', '黄染'),
        ('6', '色素沉着')],
        string="皮肤")
    ab_skin_descr = fields.Char(string="皮肤异常描述")
    sclera = fields.Selection([
        ('1', '正常'),
        ('2', '黄染'),
        ('3', '充血')],
        string="巩膜")
    ab_scleral_descr = fields.Char(string="巩膜异常描述")
    lymph_node = fields.Selection([
        ('1', '未接触'),
        ('2', '锁骨上'),
        ('3', '腋窝')],
        string="淋巴结")
    ab_lymph_node_decr = fields.Char(string="淋巴结异常描述")
    lung_barrel_chst = fields.Selection([
        ('1', '是'),
        ('2', '否')],
        string="肺-桶状胸")
    lung_respiratory_sds = fields.Selection([
        ('1', '正常'),
        ('2', '异常')],
        string="肺-呼吸音")
    lung_respiratory_descr = fields.Char(string="肺-呼吸音描述")
    lung_ralph = fields.Selection([
        ('1', '无'),
        ('2', '干罗音'),
        ('3', '湿罗音')],
        string="肺-罗音")
    lung_ralph_descr = fields.Char(string="肺-罗音描述")
    heart_rate = fields.Float(string='心脏-心率')
    heart_rhythm = fields.Selection([
        ('1', '齐'),
        ('2', '不齐'),
        ('3', '绝对不齐')],
        string="心脏-心律")
    heart_murmur = fields.Selection([
        ('1', '无'),
        ('2', '有')],
        string="心脏-杂音")
    heart_murmur_descr = fields.Char(string="心脏-杂音描述")
    abdominal_tenderness = fields.Selection([
        ('1', '无'),
        ('2', '有')],
        string="腹部-压痛")
    abdominal_tenderness_abdescr = fields.Char(string="腹部-压痛异常描述")
    abdominal_mass = fields.Selection([
        ('1', '无'),
        ('2', '有')],
        string="腹部-包块")
    abdominal_mass_abdescr = fields.Char(string="腹部-包块异常描述")
    abdominal_hepatomegaly = fields.Selection([
        ('1', '无'),
        ('2', '有')],
        string="腹部-肝大")
    abdominal_hepatomegaly_abdescr = fields.Char(string="腹部-肝大异常描述")
    abdominal_splen = fields.Selection([
        ('1', '无'),
        ('2', '有')],
        string="腹部-脾大")
    abdominal_descr = fields.Char(string="腹部-脾大描述")
    abdominal_mb_voice = fields.Selection([
        ('1', '无'),
        ('2', '有')],
        string="腹部-移动性浊音")
    abdominal_mb_voice_descr = fields.Char(string="腹部-移动性浊音描述")
    edema_lo_limb = fields.Selection([
        ('1', '无'),
        ('2', '单侧'),
        ('3', '双侧不对称'),
        ('4', '双侧对称')],
        string="下肢水肿")
    dor_pedis_artery_puls = fields.Selection([
        ('1', '未触及'),
        ('2', '触及双侧对称'),
        ('3', '触及左侧弱或消失'),
        ('4', '触及右侧弱或消失')],
        string="足背动脉搏动")
    anal_exam = fields.Selection([
        ('1', '未见异常'),
        ('2', '触痛'),
        ('3', '包块'),
        ('4', '前列腺异常')],
        string="肛门指诊")
    anus_ab_descr = fields.Char(string="肛门异常描述")
    gyn_magland = fields.Selection([
        ('1', '未见异常'),
        ('2', '异常')],
        string="妇科-乳腺")
    gyn_magland_descr = fields.Char(string="妇科-乳腺异常描述")
    gyn_vulva = fields.Selection([
        ('1', '未见异常'),
        ('2', '异常')],
        string="妇科-外阴")
    gyn_vulva_ab_descr = fields.Char(string="妇科-外阴异常描述")
    gyn_vagina = fields.Selection([
        ('1', '未见异常'),
        ('2', '异常')],
        string="妇科-阴道")
    gyn_vagina_ab_descr = fields.Char(string="妇科-阴道异常描述")
    gyn_cervix = fields.Selection([
        ('1', '未见异常'),
        ('2', '异常')],
        string="妇科-宫颈")
    gyn_cervix_ab_descr = fields.Char(string="妇科-宫颈异常描述")
    gyn_uterine_bd = fields.Selection([
        ('1', '未见异常'),
        ('2', '异常')],
        string="妇科-宫体")
    gyn_uterine_bd_abdescr = fields.Char(string="妇科-宫体异常描述")
    gyn_annex = fields.Selection([
        ('1', '未见异常'),
        ('2', '异常')],
        string="妇科-附件")
    gyn_annex_abdescr = fields.Char(string="妇科-附件异常描述")
    phy_exam_other = fields.Char(string="查体-其他")
    blood_rt_hemo = fields.Float(string='血常规-血红蛋白g/L')
    bld_rt_leukocyte = fields.Float(string='血常规-白细胞×109/L')
    bld_rt_platelet = fields.Float(string='血常规-血小板×109/L')
    bld_rt_o = fields.Char(string="血常规-其他")
    urine_rt_protein = fields.Char(string="尿常规-尿蛋白")
    urin_rt_sugar = fields.Char(string="尿常规-尿糖")
    urin_rt_ketonbd = fields.Char(string="尿常规-尿酮体")
    urin_rt_occbd = fields.Char(string="尿常规-尿潜血")
    urin_rt_o = fields.Char(string="尿常规-其他")
    fas_bd_glu_mm = fields.Float(string='空腹血糖值mmol/L')
    fas_bd_glu_mg = fields.Float(string='空腹血糖mg/dL')
    homocysteine = fields.Char(string="同型半胱氨酸")
    microalbuminuria = fields.Float(string='尿微量白蛋白')
    fec_occbld = fields.Selection([
        ('1', '阴性'),
        ('2', '阳性')],
        string="大便潜血")
    gly_hemo = fields.Float(string='糖化血红蛋白')
    hepat_b_sur_anti = fields.Selection([
        ('1', '阴性'),
        ('2', '阳性')],
        string="乙型肝炎表面抗原")
    lvr_func_serum_al_ani = fields.Float(string='肝功-血清谷丙转氨酶U/L')
    lvr_func_serum_al_tr = fields.Float(string='肝功-血清谷草转氨酶U/L')
    lvr_func_al_g = fields.Float(string='肝功-白蛋白g/L')
    lvr_func_tl_bill_mol = fields.Float(string='肝功-总胆红素μmol/L')
    lvr_func_cjtd_bill_mol = fields.Float(string='肝功-结合胆红素μmol/L')
    rnl_func_serum_crt_mol = fields.Float(string='肾功-血清肌酐μmol/L')
    kidney_func_bld_urmm = fields.Float(string='肾功-血尿素mmol/L')
    rnl_func_bld_ptm_conmm = fields.Float(string='肾功-血钾浓度mmol/L')
    rnl_func_bld_sdconmm = fields.Float(string='肾功-血钠浓度mmol/L')
    bld_lip_tl_chmm = fields.Float(string='血脂-总胆固醇mmol/L')
    bld_lpd_trmm = fields.Float(string='血脂-甘油三酯mmol/L')
    bld_lpd_serum_lowdenmm = fields.Float(string='血脂-血清低密度脂蛋白胆固醇mmol/L')
    bld_lpd_serum_highdenmm = fields.Float(string='血脂-血清高密度脂蛋白胆固醇mmol/L')

    chst_xray = fields.Selection([
        ('1', '正常'),
        ('2', '异常')],
        string="胸部X线片")
    chst_xray_descr = fields.Char(string="胸部X线片描述")
    b_ultrasd_abdom = fields.Selection([
        ('1', '正常'),
        ('2', '异常')],
        string="B超-腹部B超")
    b_ultrasd_abdom_descr = fields.Char(string="B超-腹部B超描述")
    b_ultrasd_o = fields.Selection([
        ('1', '正常'),
        ('2', '异常')],
        string="B超-其他")
    b_ultrasd_odescr = fields.Char(string="B超-其他描述")
    cerv_smr = fields.Selection([
        ('1', '正常'),
        ('2', '异常')],
        string="宫颈涂片")
    cerv_smr_descr = fields.Char(string="宫颈涂片描述")
    aux_exam_o = fields.Char(string="辅助检查-其他")
    hlth_assmt = fields.Selection([
        ('1', '体检无异常'),
        ('2', '有异常')],
        string="健康评价")
    hlth_assmt_descr = fields.Char(string="健康评价异常描述")
    createDate = fields.Date(string="建档日期", default=fields.Date.today())
    # 外键id
    manaDoctorId = fields.Char(string="责任医生")
    createUser = fields.Char(string="建档人")
    createUnit = fields.Char(string="建档机构")
    lastModifyDate = fields.Date(string="更新时间", default=fields.Date.today())
    lastModifyUser = fields.Char(string="更新操作人")
    is_delete = fields.Selection([
        ('1', '否'),
        ('2', '是')],
        string="是否删除")
    mod_stat = fields.Selection([
        ('1', '未修改不需上传'),
        ('2', '修改需要上传')],
        string="修改状态")
    abo = fields.Char(string="ABO")
    rh = fields.Char(string="Rh血型")

    sus_tb_patent = fields.Selection([
        ('1', '否'),
        ('2', '是')],
        string="可疑结核病人")
    pos_rsk_fac = fields.Selection([
        ('1', '否'),
        ('2', '是')],
        string="高危因素阳性者")
    tubcl_his = fields.Selection([
        ('1', '无'),
        ('2', '是')],
        string="结核病病史")
    pf_qty = fields.Selection([
        ('1', '是'),
        ('2', '基本是')],
        string="平和质")
    qi_def_cnstit = fields.Selection([
        ('1', '是'),
        ('2', '倾向是')],
        string="气虚质")
    pos_def_qty = fields.Selection([
        ('1', '是'),
        ('2', '倾向是')],
        string="阳虚质")
    neg_def = fields.Selection([
        ('1', '是'),
        ('2', '倾向是')],
        string="阴虚质")
    phl_def = fields.Selection([
        ('1', '是'),
        ('2', '倾向是')],
        string="痰虚质")
    hygrth_mass = fields.Selection([
        ('1', '是'),
        ('2', '倾向是')],
        string="湿热质")
    bld_stsis = fields.Selection([
        ('1', '是'),
        ('2', '倾向是')],
        string="血瘀质")
    qi_stgnt = fields.Selection([
        ('1', '是'),
        ('2', '倾向是')],
        string="气郁质")
    sp_qty = fields.Selection([
        ('1', '是'),
        ('2', '倾向是')],
        string="特禀质")
    is_tb_prt_disp = fields.Selection([
        ('1', '否'),
        ('2', '是')],
        string="是否展示结核病部分")
    nt_phy_exam_type = fields.Integer(string="全民体检类型")

    bld_ox = fields.Integer(string="血氧")
    humn_impd = fields.Integer(string="人体阻抗")
    bdy_fat = fields.Integer(string="人体脂肪")
    humn_bdy_mst = fields.Integer(string="人体水分")
    humn_bon_mass = fields.Integer(string="人体骨量")
    humn_muscl = fields.Integer(string="人体肌肉")
    bas_mbolis = fields.Integer(string="基础代谢")
    vscer_fat = fields.Integer(string="内脏脂肪")
    phy_exam_type = fields.Selection([
        ('1', '正常体检'),
        ('2', '小体检')],
        string="体检类型")
    donot_o_bld_test = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="血常规其他不做")
    donot_fas_bld_glu = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="空腹血糖不做")
    donot_urn_micrbum = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="尿微量白蛋白不做")
    occ_bld_in_stol = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="大便潜血不做")
    donot_gly_hemo = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="糖化血红蛋白不做")
    donot_hepat_b_sur_anti = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="乙型肝炎表面抗原不做")
    dont_bld_pot_concrt_msur = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="血钾浓度不做")
    dont_bld_sod_concrt_msur = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="血钠浓度不做")
    donot_chst_xray = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="胸部X线片不做")
    donot_bultrsd_o = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="B超其他不做")
    donot_cerv_smr = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="宫颈涂片不做")
    donot_crt_vis = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="矫正视力不做")
    donot_urn_rt_o = fields.Selection([
        ('1', '做'),
        ('2', '不做')],
        string="尿常规其他不做")

    ur_acid = fields.Float(string='尿酸')
    egg_charact = fields.Char(string='心电特征')
    slt_intake_num = fields.Integer(string="食盐摄入-人数")
    slt_intake_num_chld = fields.Integer(string="食盐摄入-儿童人数")
    slt_intake_avg = fields.Integer(string="食盐摄入-食盐平均")
    slt_intake_soy_avg = fields.Integer(string="食盐摄入-酱油平均")
